home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Almathera Ten Pack 3: CDPD 3
/
Almathera Ten on Ten - Disc 3: CDPD3.iso
/
scope
/
001-025
/
scopedisk15
/
snoop
/
pmsn.doc
< prev
next >
Wrap
Text File
|
1995-03-18
|
3KB
|
78 lines
*****************************************************************
* *
* Poor Man's Snoop *
* *
* Copyright 1988 by Martin J Laubach *
* All rights reserved *
* *
*****************************************************************
This program is inspired by the snoop command of the developers
toolkit disk. As it's "bigger brother" it helps to trace the
memory allocations made -- only that it writes its output not on
the serial line at 9600 Bd, but to the standard output stream
(therefore the name "poor man's" -- for people without a 9k6
terminal standing around (like me)).
To use it, just call it by typing "pmsn" at the cli prompt (or,
even better "run pmsn"). Warning: you should not use it with
the popular metacomco shell, since the shell makes a lot of small
allocations (for the command history), which make it very hard to
trace what's really going on. So you'd better start a NewCli,
and run it there. Also, you should take care to redirect the
output to a file, since some 20k of data aren't unusual. PMSN
stays dormant in the background, recording all the memory
allocation/deallocation calls to AllocMem() and FreeMem(), until
you hold the left mousebutton about 3 seconds down - of a mouse
connected to the second gameport (a joystick firebutton will do).
Then all the accumulated data is dumped to the standard output
stream.
The format of the dump is really straightforward and quite easy
to understand:
AllocMem( 00000100, 00010001) = 00200090 [00209000] [000000198]
| | | | | |
| | | | (a7) 4(a7)
| | | |
| | | Result returned by AllocMem
| | second argument (MEMF_CLEAR|MEMF_PUBLIC)
| first argument (256 bytes to allocate)
function called
FreeMem ( 00200000, 00000010) [00202020] [00202021]
| | | | |
| | | (a7) 4(a7)
| | |
| | second argument (16 bytes to free)
| first argument (address of block to be freed)
function called
Each line contains the function name, the arguments for this
function, the result (if any), as well as the first two longs on
the stack (these are included to find out where the call came
from -- an address in the 00fxxxxx usally means the function was
called by the OS).
Hope it'll help you,
---mjl
PS: Comments are *very* welcome. Mail me at mjl@alison.uucp or
uunet!tuvie!alison!mjl.SHAR_EOF
test 2913 -ne "`wc -c pmsn.doc`"
en
ho shar: error transmitting pmsn.doc '(should have been 2913 characters)'
End of shell archive
it 0
it 0
it 0
// mjl The first rule of intelligent tinkering
\X/ --- is to save all the parts.
PAUL ERLICH
PAUL ERLICH